package org.adorsys.aderp.booking.domain;

import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.jpa.entity.RooJpaEntity;
import org.springframework.roo.addon.tostring.RooToString;

@RooJavaBean
@RooToString
@RooJpaEntity
public class Invoice {

    @NotNull
    @Column(name = "invoiceKeyBk", unique = true)
    private String invoiceKey;

    @NotNull
    @Column(unique = true)
    private String invoiceNumber;

    @ManyToOne
    private OrgaPersonRef customerRef;

    @ManyToOne
    private OrgaPersonRef guestRef;

    @NotNull
    private BigDecimal invoiceAmount;

    @NotNull
    private BigDecimal valueAdddedTax;

    @NotNull
    private BigDecimal otherTaxes;

    @NotNull
    private BigDecimal gratuity;

    @NotNull
    private BigDecimal amountDue;

    private BigDecimal discount;

    @ManyToOne
    private PayementState payementState;

    @ManyToOne
    private InvoiceState invoiceState;

    private String recordOwner;

    @Temporal(TemporalType.TIMESTAMP)
    @DateTimeFormat(pattern = "dd-MM-yyyy HH:mm:ss")
    private Date dateOfClose;
}
